<template>
  <a-drawer
    width="45%"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{ height: 'calc(100vh - 100px)', overflow: 'auto' }"
    @close="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32">
          <a-col :span="12">
            <a-form-model-item label="进件ID" prop="jinjianId">
              <a-input v-model="form.jinjianId" placeholder="请输入进件ID" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="提交收入金额" prop="serviceAmount">
              <a-input-number
                v-model="form.serviceAmount"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="提交支出金额" prop="payAmount">
              <a-input-number
                v-model="form.payAmount"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认收入金额" prop="serviceAmountCheck">
              <a-input-number
                v-model="form.serviceAmountCheck"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认支出金额" prop="payAmountCheck">
              <a-input-number
                v-model="form.payAmountCheck"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="进件账单Id" prop="jinjianBillId">
              <a-input
                v-model="form.jinjianBillId"
                placeholder="请输入进件账单Id"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="是否作废" prop="isZuofei">
              <a-select
                placeholder="请选择是否作废"
                v-model="form.isZuofei"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(d, index) in isZuofeiOptions"
                  :key="index"
                  :value="d.dictValue"
                  >{{ d.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="财务确认" prop="caiwuCheck">
              <a-select
                placeholder="请选择财务确认"
                v-model="form.caiwuCheck"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(d, index) in caiwuCheckOptions"
                  :key="index"
                  :value="d.dictValue"
                  >{{ d.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="确认时间" prop="checkTime">
              <a-date-picker
                v-model="form.checkTime"
                valueFormat="YYYY-MM-DD"
                :show-today="true"
                placeholder="选择日期"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="类别" prop="type">
              <a-select
                placeholder="请选择类别"
                v-model="form.type"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(d, index) in typeOptions"
                  :key="index"
                  :value="d.dictValue"
                  >{{ d.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="排序" prop="sort">
              <a-input-number
                v-model="form.sort"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button @click="cancel"> 取消 </a-button>
          <a-button type="primary" @click="submitForm"> 保存 </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import BizJinjianBillDetailsEditForm from "./BizJinjianBillDetailsForm";
export default {
  ...BizJinjianBillDetailsEditForm,
};
</script>
